﻿using System;


namespace DotNetNuke.Modules.UserDefinedTable
{


  public class URLUtil
  {




    public static bool OpenUrlInNewWindow(ref string strURL)
    {
      string str = "";
      int index = Utilities.CStrN(strURL, "").IndexOf("|options=");
      if ((index >= 0) & (index <= (strURL.Length - 9)))
      {
        str = strURL.Substring(index + 9);
        index = str.IndexOf("|");
        if (index >= 0)
        {
          str = str.Substring(0, index - 1);
        }
      }
      return (str.IndexOf("W") >= 0);
    }





    public static string StripURL(ref string strURL)
    {
      int index = Utilities.CStrN(strURL, "").IndexOf("|");

      if (index > 0)
        return strURL.Substring(0, index);
      
      return strURL;
    }


  }

}

